package org.crazyit.cloud;

import java.util.Map;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

@SpringBootApplication
@RestController
public class ServerApp extends SpringBootServletInitializer {
	
	@RequestMapping(value = "/index")
	public ModelAndView index(Map<String, Object> data) {
		data.put("name", "angus");
		return new ModelAndView("welcome");
	}

    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application;
    }
    
	public static void main(String[] args) {
		new SpringApplicationBuilder(ServerApp.class).run(args);
	}

}
